home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Comm
/
term-source.lha
/
Extras
/
Source
/
gtlayout-Source.lha
/
LT_GetCode.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-25
|
818b
|
36 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
*/
#include "gtlayout_global.h"
WORD LIBENT
LT_GetCode(REG(d0) ULONG MsgQualifier,REG(d1) ULONG MsgClass,REG(d2) UWORD MsgCode,REG(a0) struct Gadget *MsgGadget)
{
if(MsgClass == IDCMP_RAWKEY && !(MsgCode & IECODE_UP_PREFIX) && KeymapBase)
{
UBYTE Buffer[10];
struct InputEvent Event;
LONG Len;
Event . ie_NextEvent = NULL;
Event . ie_Code = MsgCode & ~IECODE_UP_PREFIX;
Event . ie_Qualifier = MsgQualifier;
Event . ie_Class = IECLASS_RAWKEY;
Event . ie_SubClass = 0;
Event . ie_position . ie_addr = (APTR)MsgGadget;
Buffer[0] = 0;
if((Len = MapRawKey(&Event,Buffer,9,NULL)) > 0)
{
if(Buffer[0] != 0x9B || Len == 1)
return((WORD)Buffer[0]);
}
}
return(-1);
}